package com.service.impl;

import com.mapper.EmployeeMapper;
import com.pojo.Employee;
import com.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    public EmployeeMapper mapper;
//        修改密码时验证本人信息
    @Override
    public List<Employee> findEmpnoEnameIdcard(Integer empno, String ename, String idcard) {
        return mapper.findEmpnoEnameIdcard(empno, ename, idcard);
    }

//    查询员工列表
    @Override
    public List<Employee> employeeFindAll() {
        return mapper.employeeFindAll();
    }


//    模糊查询员工列表
    @Override
    public List<Employee> employeeFindLike(Integer empno, String ename, String role, String dname) {
        return mapper.employeeFindLike(empno, ename, role, dname);
    }


    @Override
    public List<Employee> employeeFindByEmpno(Integer empno) {
        return mapper.employeeFindByEmpno(empno);
    }

    @Override
    public int insertEmployee(Employee employee) {
        return mapper.insertEmployee(employee);
    }

    @Override
    public int updateEmployee(Employee employee) {
        return mapper.updateEmployee(employee);
    }

    @Override
    public int deleteEmployee(Integer empno) {
        return mapper.deleteEmployee(empno);
    }

}
